.SUFFIXES : .ml .mli .cmx .cmi .mly .mll .cmo

MLFILES         = target.ml uav_data.ml utils.ml
CMXFILES        = $(MLFILES:.ml=.cmx)
CMOFILES        = $(CMXFILES:.cmx=.cmo)
CAMLOPT         = ocamlopt -inline 100
CAML            = ocamlc -g
CAMLYACC        = ocamlyacc
CAMLLEX         = ocamllex

all: $(CMXFILES) $(CMOFILES)

.ml.cmo:
	@echo OC $<
	@$(CAML) -c $<

.ml.cmx :
	@echo OC $<
	@$(CAMLOPT) -c $<

.mli.cmi :
	@echo OC $<
	@$(CAMLOPT) -c $<

clean :
	@echo CLEAN
	@rm -f *.cm* \#*\# *.o *~  *.opt *.out .depend

.depend:
	ocamldep -native *.mli *.ml >.depend
include .depend
